<!DOCTYPE html>
  <html>
  <head>
      <meta charset="utf-8">
      <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
      <title>title</title>
      <link rel="stylesheet" type="text/css" href="../css/api.css"/>
      <style>
      body{
          padding-top: 1.5rem;
      }

            .header{
                  width: 93%;
                  height: 2.5rem;
                  line-height: 2.5rem;
                  padding: 0.5rem 0.8rem;
                  text-align: center;
                  position: fixed;
                  top:1.5rem;
                  background-color: #fff;
                  z-index: 999;
              }
              .header_img{
                width: 6%;
                height: 45%;
                float: left;
                margin-top: 0.5rem;
              }
            .header_img img{
              width: 100%;
              height: 100%;
            }
            .header h3{
              line-height: 3rem;
              width: 90%;
              text-align: center;
              margin-left: 0.7rem;
            }
      .nav {
          width:100%;
          height: 100%;
          /*background-color: rgb(242, 242, 242, 0.5);*/
          margin-top: 4rem;

      }
      .nav_one{
        width: 100%;
        height: 9rem;
        margin-bottom: 0.2rem;
        background-color: #fff;
        border-bottom: 0.1rem solid  rgb(242, 242, 242, 0.5);
      }
      .one_top{
        width: 90%;
        height: 2rem;
        padding: 0.5rem 1rem;
      }
      .top_img{
        float: left;
      }
      .one_top h3{
        float: left;
        margin-left: 0.5rem;
        height: 2rem;
        line-height: 2rem;
      }
      .top_imgs{
        float: right;
        width: 8%;
        height: 45%;
        }
        .top_imgs img{
          width: 100%;
          height: 100%；
        }
        .one_center{
          width: 90%;
          height: 4rem;
          padding: 1rem 1rem;
          background-color: rgb(242, 242, 242, 0.5);
        }
        .one_img{
          width:20%;
          height: 90%;
          float: left;
          margin-top: 0.2rem;
          margin-right: 1rem;
        }
        .one_img img{
          width: 100%;
          height: 100%;
        }
        .one_text{
          width: 70%;
          float:left;
        }
        .tp{
          font-size: 0.8rem;
        }
        .one_buttom{
          width: 90%;
          padding: 0.5rem 1rem;
          height: 2rem;
          text-align: right;
          line-height: 2rem;
          font-size: 0.9rem;
        }
      </style>
  </head>
  <body>
    <div class="header">
      <div class="header_img">
        <img src="../image/u18.png" alt="" onclick="closewin()">
      </div>
      <h3>订单管理</h3>
    </div>
    <div class="nav" id="prolist">
      <!-- <div class="nav_one">
        <div class="one_center">
          <div class="one_img">
            <img src="../image/45.png" alt="">
          </div>
          <div class="one_text">
            <h4 style="margin-bottom:0.5rem">青少年英语课程</h4>
            <p class="tp">3-6岁幼儿英语</p>
            <p class="tp">多元教学法趣味学英语，听讲读写能力综合培养</p>
        </div>
      </div>
      <div class="one_buttom">
        <p>共1个课程 <span>合计：￥500</span></p>
      </div>
    </div> -->

  </div>
  </body>
  <script type="text/javascript" src="../script/api.js"></script>
  <script type="text/javascript" src="../script/common.js"></script>
  <script type="text/javascript">
  var pro
  var userinfo = $api.getStorage('userinfo');
var page = 1
var pagesize = 10;
var ok = true

      apiready = function(){
        get_list()
        api.addEventListener({
             　　name:'scrolltobottom',
                 extra:{threshold:0}
             }, function(ret, err){
      　　　　　　get_list()
            });
      };


      function get_list() {
        if(ok==false){
          return false;
        }
        var html = ''
        var obj = $api.byId('prolist');

        api.ajax({
            url: SITE_URL+'product_api/index/mypro',
            method: 'post',
            data: {
                values: {
                    user_id: userinfo.id,
                    page:page,
                    pagesize:pagesize
                }
            }
        },function(ret, err){
            if (ret) {
              if(ret.error==200){
                for (var i = 0; i < ret.data.length; i++) {
                  var dat = ret.data[i]
                  html +='<div class="nav_one">'
                  html +='<div class="one_center">'
                  html +='<div class="one_img">'
                  html +='<img src="'+dat.pro_img+'" alt="">'
                  html +='</div>'
                  html +='<div class="one_text">'
                  html +='<h4 style="margin-bottom:0.5rem">'+cutstr(dat.pro_name,25)+'</h4>'

                  html +='<p class="tp">'+cutstr(dat.pro_title,50)+'</p>'
                  html +='</div>'
                  html +='</div>'
                  html +='<div class="one_buttom">'
                  html +='<p>共1个课程 <span>合计：￥'+dat.pay_money+'</span></p>'
                  html +='</div>'
                  html +='</div>'
                }
              $api.append(obj, html);
              page+=1
            }else{
              ok = false;
            }
                //alert( JSON.stringify( ret ) );
            } else {
              msgcode('请检查网络连接')
                //alert( JSON.stringify( err ) );
            }
        });

      }
  </script>
  </html>
